doctype html
html
  head
    meta charset="utf-8" /
    meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0" name="viewport" /
    meta content="Template" name="description" /
    = csrf_meta_tags
    = yield :meta
    title Xyy Template
    = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
    = javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
    = yield :head
  body
    #page-container.sidebar-l.sidebar-o.side-scroll.header-navbar-fixed
      nav#sidebar
        #sidebar-scroll
          /! Adding .sidebar-mini-hide to an element will hide it when the sidebar is in mini mode
          .sidebar-content
            /! Side Header
            .side-header.side-content.bg-white-op
              /! Layout API, functionality initialized in App() -> uiLayoutApi()
              button.btn.btn-link.text-gray.pull-right.hidden-md.hidden-lg data-action="sidebar_close" data-toggle="layout" type="button"
                i.fa.fa-times
              /! Themes functionality initialized in App() -> uiHandleTheme()
              a.h5.text-white href="/"
                i.fa.fa-circle-o-notch.text-primary
                span.h5.sidebar-mini-hide CRM-SYSTEM
            /! END Side Header
            /! Side Content
            .side-content
              ul.nav-main
                - @menus.each do |menu2|
                  li(class="#{'open' if menu2[:current]}")
                    a data-toggle="#{menu2[:children].present? ? 'nav-submenu' : ''}" href="#{menu2[:url]||'javascript:void(0)'}" class="#{menu2[:children].present? ? 'nav-submenu' : ''} #{'active' if menu2[:current]}"
                      - if menu2[:icon_class]
                        i class=menu2[:icon_class]
                      span.sidebar-mini-hide= menu2[:name]
                    ul
                      - menu2[:children].each do |menu3|
                        li
                          = link_to menu3[:name], menu3[:url], class: "#{'active' if menu3[:current]}"
      /! Header
      header#header-navbar.content-mini.content-mini-full
        ul.nav-header.pull-left
          li.hidden-md.hidden-lg
            /! Layout API, functionality initialized in App() -> uiLayoutApi()
            button.btn.btn-default data-action="sidebar_toggle" data-toggle="layout" type="button"
              i.fa.fa-navicon
          li.hidden-xs.hidden-sm
            /! Layout API, functionality initialized in App() -> uiLayoutApi()
            button.btn.btn-default data-action="sidebar_mini_toggle" data-toggle="layout" type="button"
              i.fa.fa-ellipsis-v
          li.visible-xs
            /! Toggle class helper (for .js-header-search below), functionality initialized in App() -> uiToggleClass()
            button.btn.btn-default data-class="header-search-xs-visible" data-target=".js-header-search" data-toggle="class-toggle" type="button"
              i.fa.fa-search
          li.js-header-search.header-search
            form.form-horizontal action="base_pages_search.html" method="post"
              .form-material.form-material-primary.input-group.remove-margin-t.remove-margin-b
                input#base-material-text.form-control name="base-material-text" placeholder="Search.." type="text" /
                span.input-group-addon
                  i.si.si-magnifier
        ul.nav-header.pull-right
          li
            .btn-group.pull-right
              button.btn.btn-link.text-gray.dropdown-toggle aria-expanded="false" data-toggle="dropdown" type="button"
                i.fa.fa-language.fa-2x.font-w700
              ul.dropdown-menu.dropdown-menu-right.font-s13.sidebar-mini-hide
                li.dropdown-header= t :change_language
                li class="#{'active' if I18n.locale==:'zh-CN'}"
                  = link_to change_locale_path(locale: 'zh-CN'), remote: true, tabindex: '-1' do
                    i.fa.fa-arrow-right.text-default.pull-right.push-15-r
                    span.font-w600 中文
                li class="#{'active' if I18n.locale==:en}"
                  = link_to change_locale_path(locale: 'en'), remote: true, tabindex: '-1' do
                    i.fa.fa-arrow-right.text-default.pull-right.push-15-r
                    span.font-w600 English
          li
            .btn-group
              a.dropdown-toggle data-toggle="dropdown" type="button" href='javascript: void(0)'
                span.push-10-l= current_user.name
                .caret.push-10-l

              ul.dropdown-menu.dropdown-menu-right
                li.dropdown-header= current_user.name
                /li
                /  a href="javascript:void(0)" tabindex="-1"
                /    i.si.si-settings.pull-right
                /    = t(:settings)
                /li.divider
                /li.dropdown-header= t :operation
                li
                  = link_to logout_path, data:{turbolinks: false}, tabindex: -1 do
                    i.si.si-logout.pull-right
                    = t(:logout)
        /! END Header Navigation Right
        /! Header Navigation Left
        ul.nav-header.pull-left
          li.hidden-md.hidden-lg
            /! Layout API, functionality initialized in App() -> uiLayoutApi()
            button.btn.btn-default data-action="sidebar_toggle" data-toggle="layout" type="button"
              i.fa.fa-navicon
          /li.hidden-xs.hidden-sm
          /  /! Layout API, functionality initialized in App() -> uiLayoutApi()
          /  button.btn.btn-default data-action="sidebar_mini_toggle" data-toggle="layout" type="button"
          /    i.fa.fa-ellipsis-v
          /li.visible-xs
          /  /! Toggle class helper (for .js-header-search below), functionality initialized in App() -> uiToggleClass()
          /  button.btn.btn-default data-class="header-search-xs-visible" data-target=".js-header-search" data-toggle="class-toggle" type="button"
          /    i.fa.fa-search
          /li.js-header-search.header-search
          /  form.form-horizontal action="base_pages_search.html" method="post"
          /    .form-material.form-material-primary.input-group.remove-margin-t.remove-margin-b
          /      input#base-material-text.form-control name="base-material-text" placeholder="#{ts :search, Course::Object}" type="text" /
          /      span.input-group-addon
          /        i.si.si-magnifier
      #rails_infos.hidden data-current-user-id='#{current_user.id}' data-locale='#{I18n.locale}'
      main#main-container
        .content style="padding: 0"
          .panel.panel-default
            .panel-heading
              .panel-title
                .html_title = @html_title
                .pull-right
                  = yield(:html_buttons)
            .panel-body
              = yield
      /footer#page-footer.content-mini.content-mini-full.font-s12.bg-gray-lighter.clearfix
      /  span= t(:system_time_and_process_time, {now: Time.now.label, process_time: (Time.now-@action_start_time).round(2)})
      /! END Footer
      /! END Page Container
      /#page-loader
      / modal 弹窗
      #application-modal.modal.application-modal aria-hidden="true" role="dialog" style="display: none;" tabindex="-1"
        .modal-dialog.modal-lg.modal-dialog-popout
          .modal-content
      #application-md-modal.modal.application-modal aria-hidden="true" role="dialog" style="display: none;" tabindex="-1"
        .modal-dialog.modal-dialog-popout
          .modal-content
      #application-sm-modal.modal.application-modal aria-hidden="true" role="dialog" style="display: none;" tabindex="-1"
        .modal-dialog.modal-sm.modal-dialog-popout
          .modal-content
  javascript:
    show_error(#{flash[:error].to_json.html_safe});
    show_notice(#{flash[:notice].to_json.html_safe});
